package cn.xval.ft.app.gen.database.entity;

import cn.xval.fc.core.database.SnowflakeIdGenerator;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.util.Date;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@Data
@Entity
@Table(name = "ProductContact")
@ToString
@EntityListeners(AuditingEntityListener.class)
public class ProductContact {
    @Id
    @GenericGenerator(name = "Snowflake", type = SnowflakeIdGenerator.class)
    @GeneratedValue(generator = "Snowflake")
    @Comment("主键")
    @Column(name = "id")
    private Long id;
    @Comment("合于代码")
    @Column(name = "code", nullable = false, length = 50)
    private String code;
    @Comment("商品名称")
    @Column(name = "name", nullable = false, length = 50)
    private String name;
    @Comment("创建时间")
    @Column(name = "createTime", updatable = false, nullable = false)
    @CreatedDate
    private Date createTime;
    @Comment("更新时间")
    @Column(name = "updateTime")
    @LastModifiedDate
    private Date updateTime;
    @Comment("交割日期")
    @Column(name = "expire", length = 8)
    private String expire;
}